<template>
  <div class="panel-view">
    <div
      class="left-panel"
      v-drag-resize="{
        mainContainer: '.panel-view',
        direction: 'right',
        minWidth: 100,
        maxWidth: 500,
        delay: 300,
      }"
    >
      <h2>Left</h2>
    </div>
    <div class="right-panel">
      <div class="top-panel">
        <h2>Right Top</h2>
      </div>
      <div
        class="bottom-panel"
        v-drag-resize="{
          mainContainer: '.panel-view .right-panel',
          direction: 'top',
          minHeight: 100,
          maxHeight: 300,
          delay: 300,
        }"
      >
        <h2>Right Bottom</h2>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss">
.panel-view {
  margin: 0 auto;
  width: 1000px;
  height: 500px;
  display: flex;
  flex-direction: row;
  border: 1px solid #999;

  .left-panel {
    width: 300px;
    border-right: 1px solid #999;
  }

  .right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;

    .top-panel {
      flex: 1;
      border-bottom: 1px solid #999;
    }

    .bottom-panel {
      height: 250px;
    }
  }

  .left-panel,
  .top-panel,
  .bottom-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
  }
}
</style>
